<template>
  <div id="monitor">
    <!-- 专题 -->
    <ImgBox />
    <el-tabs v-model="activeName">
      <el-tab-pane label="全网告警" name="first">
        <div class="monitor_box">
          <div class="monitor_title" v-for="item in box" :key="item.name">
            <div class="monitor_img">
              <img :src="item.url" alt="" />
            </div>
            <div class="monitor_text">
              <p class="num">{{ item.data }}</p>
              <p>{{ item.name }}</p>
            </div>
          </div>
        </div>
        <BadgeLeft />
      </el-tab-pane>
      <el-tab-pane label="自定义告警监控" name="second">
        <div class="custom">
          <h4>自定义告警监控查询</h4>
          <el-form ref="form" :model="form" label-width="150px" size="mini">
            <!-- <el-form-item label="业务类型:">
              <el-radio-group v-model="form.name" size="medium">
                <el-radio label="103">全部</el-radio>
                <el-radio label="ATTACH"></el-radio>
                <el-radio label="HTTP"></el-radio>
                <el-radio label="PDP"></el-radio>
                <el-radio label="TCP"></el-radio>
                <el-radio label="DNS"></el-radio>
              </el-radio-group>
            </el-form-item> -->
            <!-- <el-form-item label="位置类型:">
              <el-radio-group v-model="form.region" size="medium">
                <el-radio label="LAC"></el-radio>
                <el-radio label="RAC"></el-radio>
                <el-radio label="CI"></el-radio>
              </el-radio-group>
            </el-form-item> -->
            <el-form-item label="用户类别:">
              <el-radio-group v-model="form.resource" size="medium">
                <el-radio label="企业apn"></el-radio>
                <el-radio label="个人号码"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="查询内容:">
              <div class="search_box">
                <div class="search">
                  <el-input
                    class="import"
                    :placeholder="placeholderval"
                    clearable
                    v-model="search"
                    @change="query"
                  >
                  </el-input>
                </div>
                <el-button size="mini" type="primary" @click="query"
                  >查询</el-button
                >
                <el-button size="mini" @click="Reset">重置</el-button>
              </div>
            </el-form-item>
          </el-form>
          <el-table
            :data="tableData"
            stripe
            style="background-color: transparent; margin: auto"
            :height="height"
          >
            <el-table-column
              prop="p_hour"
              label="时间戳"
              align="center"
            >
            </el-table-column>
            <el-table-column
              prop="city_name"
              label="归属地市"
              align="center"
            >
            </el-table-column>
            <el-table-column prop="msisdn" label="用户号码" align="center">
            </el-table-column>
            <el-table-column prop="tac" label="tac" align="center">
            </el-table-column>
            <el-table-column
              prop="cellid"
              label="cellid"
              align="center"
            >
            </el-table-column>
            <el-table-column prop="apn" label="企业apn" align="center">
            </el-table-column>
            <el-table-column prop="fault_type" label="故障类型" align="center">
            </el-table-column>
            <el-table-column
              prop="userport"
              label="端口"
              align="center"
            >
            </el-table-column>
            <el-table-column
              prop="ulthroughput"
              label="上行流量"
              align="center"
            >
            </el-table-column>
            <el-table-column
              prop="dlthroughput"
              label="下行流量"
              align="center"
            >
            </el-table-column>
            <el-table-column
              prop="start_time"
              label="开始时间"
              align="center"
              width="130"
            >
            </el-table-column>
            <el-table-column
              prop="register_time"
              label="登记时间"
              align="center"
              width="130"
            >
            </el-table-column>
          </el-table>
          <!-- 分页 -->
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="pageNum"
            :page-sizes="[15, 50, 100, 200, 300]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
          >
          </el-pagination>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script src="./Monitor.js"></script>

<style lang="scss">
#monitor {
  height: 95vh;
  background-color: #eef1f9;
  .img_box {
    position: absolute;
    right: 0.5vw;
    .el-table {
      width: 95% !important;
      &::before {
        background-color: transparent;
      }
    }
    .el-table__body {
      width: 100.05% !important;
    }
    .el-table th {
      color: black;
      background-color: #e7f7ff;
      border-bottom: 1px solid #e7f7ff;
    }
    .el-table td {
      color: black;
      border: 1px solid #ffffff;
      background-color: #ffffff;
    }
    .el-table__empty-block {
      height: 0 !important;
      background-color: #ffffff;
    }
    // 滚动条
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      background-color: #ddd;
      border-radius: 3px;
    }
    .current-row {
      background-color: #ECF5FF;
      td {
        background-color: transparent;
      }
    }
  }
  /*1.显示滚动条：当内容超出容器的时候，可以滚动。：*/
  .el-drawer__body {
    overflow: auto;
  }

  /*2.隐藏滚动条这里可以让右边的滚动条不显示*/
  .el-drawer__container ::-webkit-scrollbar {
    display: none;
  }
  .el-tabs__active-bar,
  .el-tabs__nav-wrap::after {
    display: none;
  }
  .el-tabs__header {
    margin: 0;
    position: absolute;
    top: 21vh;
    left: 1vw;
  }
  .el-tabs__nav {
    width: 15vw;
    height: 4vh;
  }
  .el-tabs__content {
    width: 98vw;
    height: 73vh;
    position: absolute;
    top: 25vh;
    left: 1vw;
    border: 1px solid #1e83a0;
    .monitor_box {
      width: 40vw;
      height: auto;
      margin: auto;
      margin-top: 20px;
      margin-bottom: 20px;
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      .monitor_title {
        width: auto;
        height: auto;
        display: flex;
        flex-flow: row nowrap;
        justify-content: center;
        align-items: center;
        border: 2px solid #1e83a0;
        border-radius: 5px;
        padding: 10px;
        .monitor_img {
          margin-right: 10px;
        }
        .monitor_text {
          width: auto;
          text-align: center;
          color: #1e83a0;
          .num {
            font-weight: bold;
            margin-bottom: 10px;
          }
        }
      }
    }
    .search_box {
      display: flex;
      flex-flow: row nowrap;
      .search {
        height: 30px;
        padding: 5px;
        display: flex;
        flex-flow: row nowrap;
        align-items: center;
        background: url("../../assets/image/rectangle6.png") no-repeat;
        background-size: 100% 100%;
        margin-right: 5px;
        input {
          width: 17vw;
          height: 30px;
          padding-left: 3px;
          font-size: 16px;
          font-family: Microsoft YaHei, Microsoft YaHei-Regular;
          font-weight: 400;
          &::placeholder {
            color: #005185;
          }
        }
      }
    }
    .import .el-input__inner::placeholder {
      color: #005185 !important;
    }
    .import .el-input__inner {
      width: 14vw;
      height: 4vh;
      padding-left: 3px;
      font-size: 16px;
      font-family: Microsoft YaHei, Microsoft YaHei-Regular;
      font-weight: 400;
      padding-left: 5px;
      background-color: transparent !important;
      border: 0 !important;
    }
    .el-table {
      width: 95% !important;
      &::before {
        background-color: transparent;
      }
    }
    .el-table__body {
      width: 100.05% !important;
    }
    .el-table th {
      padding-left: 10px;
      color: black;
      background-color: #b7cdf5;
      border-bottom: 1px solid #b2c3e3;
    }
    .el-table td {
      color: black;
      border: 1px solid #c2cbde;
      background-color: #eef1f9;
    }
    .el-table__empty-block {
      height: 0 !important;
      background-color: #0095ff33;
    }
    .el-table__empty-text {
      font-size: 18px;
    }
    // 滚动条
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 7px;
      height: 7px;
    }
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      background-color: #ddd;
      border-radius: 3px;
    }
    /* 分页按钮 */
    .el-pagination {
      margin-top: 5px;
      padding: 2px 130px;
    }
    .custom {
      padding: 1vw 1vw;
      h4 {
        margin-bottom: 20px;
      }
    }
  }
  .el-tabs__nav-scroll {
    width: 17vw;
    background-color: #edf1f9;
  }
  .el-tabs__item {
    width: 6vw;
    height: 4vh;
    padding: 0;
    text-align: center;
    background: url("../../assets/image/shape11.png") no-repeat;
    background-size: 100% 100%;
    margin-right: 20px;
  }
  .el-tabs__item.is-active {
    background: url("../../assets/image/shape1.png") no-repeat;
    background-size: 100% 100%;
    color: white;
  }
}
@media screen and (max-width: 1600px) {
  #monitor {
    height: 95vh;
    background-color: #eef1f9;
    .img_box {
      position: absolute;
      right: 0.5vw;
    }
    /*1.显示滚动条：当内容超出容器的时候，可以滚动。：*/
    .el-drawer__body {
      overflow: auto;
    }

    /*2.隐藏滚动条这里可以让右边的滚动条不显示*/
    .el-drawer__container ::-webkit-scrollbar {
      display: none;
    }
    .el-tabs__active-bar,
    .el-tabs__nav-wrap::after {
      display: none;
    }
    .el-tabs__header {
      margin: 0;
      position: absolute;
      top: 21vh;
      left: 1vw;
    }
    .el-tabs__nav {
      width: 20vw;
      height: 4vh;
    }
    .el-tabs__content {
      width: 98vw;
      height: 73vh;
      position: absolute;
      top: 25vh;
      left: 1vw;
      border: 1px solid #1e83a0;
      .monitor_box {
        width: 50vw;
        height: auto;
        margin: auto;
        margin-top: 20px;
        margin-bottom: 20px;
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        .monitor_title {
          width: auto;
          height: auto;
          display: flex;
          flex-flow: row nowrap;
          justify-content: center;
          align-items: center;
          border: 2px solid #1e83a0;
          border-radius: 5px;
          padding: 10px;
          .monitor_img {
            margin-right: 10px;
          }
          .monitor_text {
            width: auto;
            text-align: center;
            color: #1e83a0;
            .num {
              font-weight: bold;
              margin-bottom: 10px;
            }
          }
        }
      }

      .search_box {
        display: flex;
        flex-flow: row nowrap;
        .search {
          height: 3vh;
          padding: 5px;
          display: flex;
          flex-flow: row nowrap;
          align-items: center;
          background: url("../../assets/image/rectangle6.png") no-repeat;
          background-size: 100% 100%;
          margin-right: 5px;
          input {
            width: 17vw;
            height: 4vh;
            padding-left: 3px;
            font-size: 16px;
            font-family: Microsoft YaHei, Microsoft YaHei-Regular;
            font-weight: 400;
            &::placeholder {
              color: #005185;
            }
          }
        }
      }
      .import .el-input__inner::placeholder {
        color: #005185 !important;
      }
      .import .el-input__inner {
        width: 14vw;
        height: 4vh;
        padding-left: 3px;
        font-size: 16px;
        font-family: Microsoft YaHei, Microsoft YaHei-Regular;
        font-weight: 400;
        padding-left: 5px;
        background-color: transparent !important;
        border: 0 !important;
      }
      .el-table {
        width: 95% !important;
        &::before {
          background-color: transparent;
        }
      }
      .el-table__body {
        width: 100.02% !important;
      }
      .el-table th {
      padding-left: 10px;
        color: black;
        background-color: #b7cdf5;
        border-bottom: 1px solid #b2c3e3;
      }
      .el-table td {
        color: black;
        border: 1px solid #c2cbde;
        background-color: #eef1f9;
      }
      .el-table__empty-block {
        height: 0 !important;
        background-color: #0095ff33;
      }
      .el-table__empty-text {
        font-size: 18px;
      }
      // 滚动条
      .el-table__body-wrapper::-webkit-scrollbar {
        width: 7px;
        height: 7px;
      }
      .el-table__body-wrapper::-webkit-scrollbar-thumb {
        background-color: #ddd;
        border-radius: 3px;
      }
      /* 分页按钮 */
      .el-pagination {
        margin-top: 5px;
        padding: 2px 130px;
      }
      .custom {
        padding: 1vw 1vw;
        h4 {
          margin-bottom: 20px;
        }
      }
    }
    .el-tabs__nav-scroll {
      width: 20vw;
      background-color: #edf1f9;
    }
    .el-tabs__item {
      width: 8vw;
      height: 4vh;
      padding: 0;
      text-align: center;
      background: url("../../assets/image/shape11.png") no-repeat;
      background-size: 100% 100%;
      margin-right: 20px;
      line-height: 30px;
    }
    .el-tabs__item.is-active {
      background: url("../../assets/image/shape1.png") no-repeat;
      background-size: 100% 100%;
      color: white;
    }
  }
}
</style>